package com.qfedu.dao;

import com.qfedu.entity.Course;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.Date;
import java.util.List;

public interface CourseDao {

    @Insert("insert into qfoffice2.t_course (name, createtime, week, type) VALUES (#{name}, #{createtime}, #{week}, #{type})")
    int addCourse(Course course);

    @Select("select * from qfoffice2.t_course")
    List<Course> getAllCourse();

    @Delete("delete from qfoffice2.t_course where id = #{id}")
    int deleteCourseById(int id);

    @Update("update qfoffice2.t_course set name = #{name}, createtime = #{createtime}, week = #{week}, type = #{type}, flag = #{flag} where id = #{id}")
    int updateCourse(Course course);

}
